package com.gxa.service.investment.impl;

import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.gxa.entity.investment.Project;
import com.gxa.entity.investment.ProjectCenter;
import com.gxa.entity.points.IntegralType;
import com.gxa.mapper.investment.ProjectMapper;
import com.gxa.service.investment.HistoryProjectService;
import com.gxa.vo.ProjectVo;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

public class HistoryProjectServiceImpl implements HistoryProjectService {
    @Autowired
    private ProjectMapper projectMapper;
    @Override
    public PageInfo queryAll(Integer pageNum, Integer pageSize) {
        Page<Project> page = PageHelper.startPage(pageNum,pageSize);
        List<Project> projectList = this.projectMapper.Historys();
        PageInfo<Project> pageInfo = new PageInfo<>(projectList);
        return pageInfo;
    }

    @Override
    public PageInfo<Project> queryByVo(ProjectVo projectVo) {
        Page<IntegralType> page1 = PageHelper.startPage(projectVo.getPageNumber(),projectVo.getPageSize());
        List<Project> projectList = this.projectMapper.historyByVo(projectVo);
        PageInfo<Project> pageInfo = new PageInfo<Project>(projectList);
        return pageInfo;
    }
}
